﻿using LuShanTea.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuShanTea.IService
{
    public interface IAreaService : IServiceSupport
    {
        /// <summary>
        /// 添加区
        /// </summary>
        /// <param name="name"></param>
        /// <param name="cityId"></param>
        /// <returns>如果区域名存在抛异常</returns>
        long AddNew(string name, long cityId);
        /// <summary>
        /// 修改区域
        /// </summary>
        void Update(long areaId, string name, long cityId);
        /// <summary>
        /// 软删除区
        /// </summary>
        /// <param name="areaId"></param>
        void MarkDelete(long areaId);
        /// <summary>
        /// 获取所有区域
        /// </summary>
        /// <returns></returns>
        AreaDTO[] GetAll();
        /// <summary>
        /// 根据Id获取区
        /// </summary>
        /// <param name="areaId"></param>
        /// <returns></returns>
        AreaDTO GetById(long areaId);
        /// <summary>
        /// 获取指定市下的区
        /// </summary>
        /// <param name="cityId"></param>
        /// <returns></returns>
        AreaDTO[] GetByCityId(long cityId);
        /// <summary>
        /// 根据区域名获取区域
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        AreaDTO GetByName(string name);
    }
}
